//
// Created by 七 on 2022/11/15.
//
#include <iostream>
using namespace std;
class Point{
public:
    Point(double new_x,double new_y);
    Point(const Point& p);
    void disp();
    void disp()const;
private:
    double x;
    const double y;
};
Point::Point(double new_x,double new_y):y(new_y){
    x=new_x;
}
Point::Point(const Point& p):y(p.y){
    x=p.x;
}
void Point::disp () const{
    cout<<"您正在调用一个常函数成员,";
    cout<<"该点的坐标为:("<<x<<","<<y<<")"<<endl;
}
void Point::disp (){
    cout<<"该点的坐标为:("<<x<<","<<y<<")"<<endl;
}
int main() {
    Point p1(1,2),p2(p1);
    const Point p(4,5);  		//p为常对象
    p1.disp ();
    p2.disp ();
    p.disp (); 			//p调用常函数成员disp
    return 0;
}